package com.atguigu.spring.beans.collections;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 夏焰波
 * @date 2020-08-19 0:32
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        Person person = (Person) ctx.getBean("person3");
        System.out.println(person);

        NewPerson newPerson = (NewPerson) ctx.getBean("newPerson");
        System.out.println(newPerson);

        Object dataSource = ctx.getBean("dataSource");
        System.out.println(dataSource.getClass());

        DataSource dataSource2 = ctx.getBean(DataSource.class);
        System.out.println(dataSource2.getProperties());

        Person person4 = (Person) ctx.getBean("person4");
        System.out.println(person4);

        Person person5 = (Person) ctx.getBean("person5");
        System.out.println(person5);
    }
}
